<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script>
    var ctx = '${ctx}';
</script>
<div class="content-wrap">
    <div class="wrapper">
        <section class="panel panel-default" style="height: 97%">
            <div class="panel-body height-100">
                <div class="col-lg-3 height-100">
                    <div class="div_title">
                        <div class="green">
                            <div class="green-01">病人列表</div>
                        </div>
                    </div>
                    <fieldset class="height-100">
                    <form:form id="searchForm" modelAttribute="bloodOutSheet"
                               onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/blood/bloodOutSheet/index');"
                               method="post" class="form-inline">
                        <label class="pull-left">开始时间：</label>
                        <div class="col-sm-8"><input id="startDateId" name="startDate" onFocus="var endDateId=$dp.$('endDateId');WdatePicker({onpicked:function(){endDateId.focus();},maxDate:'#F{$dp.$D(\'endDateId\')}'})" readonly class="form-control Wdate"  value="<fmt:formatDate value="${bloodOutSheet.startDate}" pattern="yyyy-MM-dd"/>" /></div>
                        <label class="pull-left">结束时间：</label>
                        <div class="col-sm-8 mt5"><input id="endDateId" name="stopDate"  onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startDateId\')}'})"  readonly class="form-control Wdate"  value="<fmt:formatDate value="${bloodOutSheet.stopDate}" pattern="yyyy-MM-dd"/>" /></div>
                        <div class="pull-right mt5 mr10 mb5">
                            <button class="btn btn-primary" type="submit">查询</button>
                        </div>
                    </form:form>
                        <table class="table table-bordered mg-t datatable">
                            <thead>
                            <tr>
                                <th>申请单号</th>
                                <th>姓名</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${list}" var="bos">
                                <tr onclick="loadListData('${bos.applyNum}','${bos.visitNo}','${bos.patientName}','${bos.sex}','${bos.age}','${bos.appDept}','${bos.patBloodGroup}','${bos.rh}','${bos.chargeType}','${bos.createDate}','${bos.appDoctorName}','${bos.fastSlow}')">
                                    <td>${bos.applyNum}</td>
                                    <td>${bos.patientName}</td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                    </fieldset>
                </div>
                <form:form id="inputSheetForm" data-parsley-validate="" modelAttribute="bloodOutSheet" onsubmit="return formSaveLoad('mainCenterDiv','inputSheetForm','${ctx}/blood/bloodOutSheet/save','${ctx}/blood/bloodOutSheet/index');" method="post" class="form-horizontal">
                    <div class="col-lg-9 height-100">
                        <div class="col-lg-12 p0">
                            <div class="div_title">
                                <div class="green">
                                    <div class="green-01">基本信息</div>
                                </div>
                            </div>
                            <fieldset>
                                <form class="form-horizontal">
                                    <div class="col-lg-3">
                                        <div class="form-group m0">
                                            <label class="col-lg-5 p0 control-label">住   院   号：</label>
                                            <div class="col-lg-7 p0">
                                                <label class="usual_label" id="visitNo"></label>
                                            </div>
                                        </div>
                                        <div class="form-group m0">
                                            <label class="col-lg-5 p0 control-label">所在科室：</label>
                                            <div class="col-lg-7 p0">
                                                <label class="usual_label" id="appDept"></label>
                                            </div>
                                        </div>
                                        <div class="form-group m0">
                                            <label class="col-lg-5 p0 control-label">申请日期：</label>
                                            <div class="col-lg-7 p0">
                                                <label class="usual_label" id="createDate"></label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-lg-3">
                                        <div class="form-group m0">
                                            <label class="col-lg-5 p0 control-label">姓名：</label>
                                            <div class="col-lg-7 p0">
                                                <label class="usual_label" id="patientName"></label>
                                            </div>
                                        </div>
                                        <div class="form-group m0">
                                            <label class="col-lg-5 p0 control-label">血型：</label>
                                            <div class="col-lg-7 p0">
                                                <label class="usual_label" id="patBloodGroup"></label>
                                            </div>
                                        </div>
                                        <div class="form-group m0">
                                            <label class="col-lg-5 p0 control-label">开单医生：</label>
                                            <div class="col-lg-7 p0">
                                                <label class="usual_label" id="appDoctorName"></label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-lg-3">
                                        <div class="form-group m0">
                                            <label class="col-lg-3 p0 control-label">性别：</label>
                                            <div class="col-lg-3 p0">
                                                <label class="usual_label" id="sex"></label>
                                            </div>
                                            <label class="col-lg-3 p0 control-label">年龄：</label>
                                            <div class="col-lg-3 p0">
                                                <label class="usual_label" id="age"></label>
                                            </div>
                                        </div>
                                        <div class="form-group m0">
                                            <label class="col-lg-3 p0 control-label">RH：</label>
                                            <div class="col-lg-3 p0">
                                                <label class="usual_label" id="rh"></label>
                                            </div>
                                            <label class="col-lg-3 p0 control-label">费别：</label>

                                            <div class="col-lg-3 p0">
                                                <label class="usual_label" id="chargeType"></label>
                                            </div>
                                        </div>
                                        <div class="form-group m0">
                                            <label class="col-lg-3 p0 control-label">用血方式：</label>
                                            <div class="col-lg-9 p0">
                                                <label class="usual_label" id="fastSlow"></label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-lg-3">
                                        <button class="btn btn-primary" type="submit">保存</button>
                                    </div>
                                </form>
                            </fieldset>
                        </div>
                        <div class="col-lg-6 p0">
                            <div class="div_title">
                                <div class="green">
                                    <div class="green-01">血液需求</div>
                                </div>
                            </div>
                            <fieldset class="height-170 overflow-auto">
                                <table class="table table-bordered mg-t datatable">
                                    <thead>
                                    <tr>
                                        <th>用血安排</th>
                                        <th>申请日期</th>
                                        <th>输血量</th>
                                        <th>单位</th>
                                        <th>成分</th>
                                    </tr>
                                    </thead>
                                    <tbody id="applyDataTbody"></tbody>
                                </table>
                            </fieldset>
                        </div>
                        <div class="col-lg-6 p0">
                            <div class="div_title">
                                <div class="green">
                                    <div class="green-01">已配血液</div>
                                </div>
                            </div>
                            <fieldset class="height-170 overflow-auto">
                                <table class="table table-bordered mg-t datatable">
                                    <thead>
                                    <tr>
                                        <th>血袋号</th>
                                        <th>血液成分</th>
                                        <th>血型</th>
                                        <th>储血量</th>
                                        <th>有效期限</th>
                                    </tr>
                                    </thead>
                                    <tbody id="matchDataTbody">
                                    </tbody>
                                </table>
                            </fieldset>
                        </div>
                        <div class="col-lg-12 p0">
                            <form:form id="searchForm" modelAttribute="bloodMatch" method="post" class="form-inline">
                                <label >取血者：</label>
                                <select name="lxOpertor" id="lxOpertor" >
                                    <c:forEach items="${users}" var="u">
                                        <option value="${u.id}" >${u.name}</option>
                                    </c:forEach>
                                </select>
                            </form:form>

                            <div class="div_title">
                                <div class="green">
                                    <div class="green-01">发血区</div>
                                </div>
                            </div>
                            <fieldset>
                                <table class="table table-bordered mg-t datatable">
                                    <thead>
                                    <tr>
                                        <th>血袋号</th>
                                        <th>血液成分</th>
                                        <th>血型</th>
                                        <th>RH血型</th>
                                        <th>储血量</th>
                                        <th>单位</th>
                                        <th>有效日期</th>
                                        <th>献血者</th>
                                        <th>应收金额</th>
                                        <th>实收金额</th>
                                    </tr>
                                    </thead>
                                    <tbody id="outSheetDataTbody"></tbody>
                                </table>
                            </fieldset>
                        </div>
                    </div>
                </form:form>
            </div>
        </section>
    </div>
</div>
<script src="${ctxStatic}/js/blood/bloodOutSheet.js"></script>

